package com.kira.scaffoldmvc.POJO;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.time.ZonedDateTime;
import java.util.List;

@Data
public class File {
    private Integer code;
    private FileData data;

    @Data
    public static class FileData {
        @JsonProperty("documents")
        private List<Document> documents;
        private Integer total;
    }

    @Data
    public static class Document {
        @JsonProperty("_id")
        private String id;
        private String name;
        private String url;
        private String type;
        @JsonProperty("bucketFileId")
        private String bucketFileId;
        @JsonProperty("accountId")
        private String accountId;
        private String extension;
        private Integer size;
        private List<?> users; // 如果不确定 users 具体类型，暂时用<?>表示，后续可根据实际情况调整
        private Owner owner;
        @JsonProperty("createdAt")
        private ZonedDateTime createdAt;
        @JsonProperty("updatedAt")
        private ZonedDateTime updatedAt;
        @JsonProperty("__v")
        private Integer version;
    }

    @Data
    public static class Owner {
        @JsonProperty("_id")
        private String id;
        private String fullName;
        private String email;
        @JsonProperty("accountId")
        private String accountId;
        private String avatar;
        @JsonProperty("createdAt")
        private ZonedDateTime createdAt;
        @JsonProperty("updatedAt")
        private ZonedDateTime updatedAt;
        @JsonProperty("__v")
        private Integer version;
    }
}